package com.cmyshare.design.strategyAndFactorySpring;

/**
 * @version 1.0
 * @Author cmy
 * @Date 2025/10/13 16:22
 * @desc 微信支付实现
 */
@Service("WECHAT")
public class WechatPayStrategy implements PaymentStrategy {

    @Override
    public PaymentResult pay(PaymentRequest request) {
        // 实际项目中这里会调用微信支付API
        System.out.println("执行微信支付: 订单" + request.getOrderId() +
                ", 金额" + request.getAmount() + "元");

        // 模拟支付结果
        return new PaymentResult(true, "微信支付成功",
                "WECHAT" + System.currentTimeMillis());
    }
}
